USE [GradingSystemDb]

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Matriculations] (
	[EmployeeId] [int] NOT NULL,
	[ScheduleId] [int] NOT NULL,
	[GradePoint] [decimal](6, 2) NOT NULL CONSTRAINT [DF_Matriculations_GradePoint] DEFAULT ((7.00)),
	[CreatedBy] [int] NOT NULL,
	[CreatedDttm] [datetime] NOT NULL,
	[ModifiedBy] [int] NOT NULL,
	[ModifiedDttm] [datetime] NOT NULL
) 
ON [PRIMARY]

GO
ALTER TABLE	[dbo].[Matriculations] WITH CHECK ADD CONSTRAINT [FK_Employees_EmployeeId_Matriculations_EmployeeId] FOREIGN KEY([EmployeeId])
REFERENCES  [dbo].[Employees] ([EmployeeId])
GO
ALTER TABLE [dbo].[Matriculations] CHECK CONSTRAINT [FK_Employees_EmployeeId_Matriculations_EmployeeId]
GO
ALTER TABLE	[dbo].[Matriculations] WITH CHECK ADD CONSTRAINT [FK_Schedules_ScheduleId_Matriculations_ScheduleId] FOREIGN KEY([ScheduleId])
REFERENCES  [dbo].[Schedules] ([ScheduleId])
GO
ALTER TABLE [dbo].[Matriculations] CHECK CONSTRAINT [FK_Schedules_ScheduleId_Matriculations_ScheduleId]

